import http from './request'
//这里配置不同服务器下的接口
var url = {
    login:`/LoginServlet`,
    categoryList:'/getCagetoryList',//分类列表
    blogList:'/getBlogList',//博客列表
    commBlog:'/getCommBlogServlet',//推荐博客列表
    record:'/recordServlet',//访客记录
    getBlogListByStr:'/getBlogListByStr',//查询博客列表
    Upload:'/UploadServlet',//文件上传
    addFile:'/addFileServlet',//上传资源
    getBlogListByCategory:'/getBlogListByCategory',//通过分类获取博客列表
    addBlog:'/addBlogServlet',//添加博客
    getFileList:'/getFileListServlet',//获取资源列表
    getFileDetail:'/getFileDetailServlet',//获取资源详情
}
const API = {
    login(data){
        return http.post(url.login,data)
    },
    getCategoryList(data){
        return http.get(url.categoryList,data)
    },
    getBlogList(data){
        return http.get(url.blogList,data)
    },
    getCommBlog(data){
        return http.get(url.commBlog,data)
    },
    getRecord(data){
        return http.get(url.record,data)
    },
    getBlogListByStr(data){
        return http.get(url.getBlogListByStr,data)
    },
    Upload(data){
        return http.post(url.Upload,data)
    },
    addFile(data){
        return http.post(url.addFile,data)
    },
    getBlogListByCategory(data){
        return http.get(url.getBlogListByCategory,data)
    },
    addBlog(data){
        return http.post(url.addBlog,data)
    },
    getFileList(data){
        return http.get(url.getFileList,data)
    },
    getFileDetail(data){
        return http.post(url.getFileDetail,data)
    }
}
export default API